package com.handsome.装饰者模式.JDK源码;

import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;

/**
 * @author niechun
 * @date 2023/2/27 20:50
 */
public class Source {
    public static void main(String[] args) throws FileNotFoundException {

        /**
         *  IO结构 FilterInputStream就是一个装饰者
         *  FileInputStream类是InputStream类的子类，相当于前面的LongBack
         *  FilterInputStream类也是InputStream类的子类，相当于前面的Decorator,可以看到FilterInputStream类中有InputStream属性
         *  protected volatile InputStream in
         *  DataInputStream类是FilterInputStream类的子类,相当于前面的Milk
         *
         */
        InputStream dis=new DataInputStream(new FileInputStream("d:\\abc"));
    }
}
